/**
 * 测试类：模拟完整业务流程
 */
public class TestSystem {
    public static void main(String[] args) {
        // 1. 创建系统实例
        CourseSelectionSystem system = new CourseSelectionSystem();

        // 2. 创建实体对象
        Course course1 = new Course("C001", "Java编程", "A101", "周一8:00-10:00");
        Course course2 = new Course("C002", "数据结构", "B202", "周三14:00-16:00");
        Teacher teacher1 = new Teacher("T001", "张老师", "男");
        Teacher teacher2 = new Teacher("T002", "李老师", "女");
        Student student1 = new Student("S001", "小明", "男");
        Student student2 = new Student("S002", "小红", "女");

        // 3. 将实体添加到系统
        system.addCourse(course1);
        system.addCourse(course2);
        system.addTeacher(teacher1);
        system.addTeacher(teacher2);
        system.addStudent(student1);
        system.addStudent(student2);

        // 4. 教师开课
        system.teacherOpenCourse("T001", "C001");
        system.teacherOpenCourse("T002", "C002");

        // 5. 学生选课/退课
        student1.selectCourse("C001");
        student1.selectCourse("C002");
        student2.selectCourse("C001");
        student1.dropCourse("C002");

        // 6. 调用重写的工作单方法（多态体现）
        System.out.println("=== 打印工作单（父类方法子类实现） ===");
        teacher1.printWorkSheet();  // 调用Teacher重写的方法
        student1.printWorkSheet();  // 调用Student重写的方法

        // 7. 打印详细课表
        System.out.println("=== 打印详细课表 ===");
        system.printStudentDetailSchedule("S001");
        system.printStudentDetailSchedule("S002");
    }
}